module Get_email where

import Text.Regex
import EmailTest


getHeader :: Email -> String
getHeader m = fmap (\ (x,y,z,w) -> x) . (matchRegexAll (mkRegex "\n\n\n") )

getBody :: Email -> Body
getBody m = Body ( (\ (Just x) -> x) fmap (\(x,y,z,w) -> z) (matchRegexAll (mkRegex "\n\n\n") m) )